public class MainActivity extends AppCompatActivity {
    private Spinner spinner;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        String[] activities = {"RobotActivity","ImageActivity","VideoActivity","ShopActivity"};
        spinner = (Spinner) findViewById(R.id.spinner);
        ArrayAdapter<String> adapter=new ArrayAdapter<String>
                (this,android.R.layout.simple_spinner_dropdown_item,activities);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(adapter);
        Button btnStart =(Button)findViewById(R.id.btnStart);
        btnStart.setOnClickListener(view->{
            String activity ="com.example.Robot."+spinner.getSelectedItem().toString();
            try {
                Intent intent=new Intent(MainActivity.this,Class.forName(activity));
                startActivity(intent);
            }
            catch (ClassNotFoundException e){
                e.printStackTrace();
                return;
            }
        });
    }
}
